home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8795 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: library.erc.clarkson.edu!rpi!not-for-mail
  2. From: Andrew Dalgleish <andrewd@axonet.com.au>
  3. Newsgroups: comp.lang.c++.moderated,comp.lang.c
  4. Subject: Re: Tool for removing surplus #includes
  5. Date: 6 Mar 1996 12:04:31 -0000
  6. Organization: Axon Research, Pty Ltd
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: devitto@ferndown.ate.slb.com
  9. Message-ID: <4hjv0f$72r@netlab.cs.rpi.edu>
  10. References: <4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu> <4h2kto$c9k@netlab.cs.rpi.edu> <4hfccd$jun@netlab.cs.rpi.edu>
  11. NNTP-Posting-Host: netlab.cs.rpi.edu
  12. X-Original-Date: Wed, 06 Mar 1996 19:37:34 +1000
  13.  
  14. John A Hughes wrote:
  15.  
  16. [snip]
  17.  
  18. > A file should contain exactly the header files it depends on, no more and
  19. > no less. If removing a #include causes you to add it somewhere else, you
  20. > were relying on a non-local and confusing inclusion structure anyway, which
  21. > you should be thrilled to have exposed. And why should one expect changing
  22. > a header file not to "break" code that includes it anyway?
  23. > I *hate* it when people give me libraries that insist I include something in
  24. > order to include their file, or have to put includes in a certain order. It's
  25. > stupid and unnecessary if you follow the simple rule above.
  26.  
  27. I agree. Here at Axon we also apply this concept to libraries.
  28.  
  29. Although a tool to ensure each #include is surrounded by the right 
  30. #if's should be easy. The biggest trouble would be tracking which definition 
  31. to use.
  32.  
  33. -- 
  34. Andrew Dalgleish
  35. Senior Software Engineer
  36. Axon Research, Pty Ltd
  37. 6 Wallace Ave
  38. Toorak, VIC
  39. 3142
  40. AUSTRALIA
  41. Tel:    +61-3-9826-5538
  42. Fax:    +61-3-9824-0083
  43. Email:    andrewd@axonet.com.au
  44.  
  45.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  46.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  47.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  48.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  49.